package com.usooft.metaTalent.db.system;

import com.usooft.framework.core.query.Page;
import com.usooft.framework.web.auth.RequiresPermission;
import com.usooft.metaTalent.core.system.service.EmployeeWxOpenUserService;
import com.usooft.metaTalent.core.system.wrapper.EmployeeWxOpenUserWrapper;
import com.usooft.metaTalent.db.system.form.EmployeeWxOpenUserListForm;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/system/employee-wx-open-user")
@RequiredArgsConstructor
public class EmployeeWxOpenUserController {
    private final EmployeeWxOpenUserService employeeWxOpenUserService;

    @GetMapping("/list")
    @RequiresPermission(
            value = "/system/employee-wx-open-user/list",
            description = "员工关联微信开放平台用户/查询"
    )
    public ResponseEntity<?> list(EmployeeWxOpenUserListForm form) {
        Page<EmployeeWxOpenUserWrapper> page = employeeWxOpenUserService.page(form.buildQuery());
        return ResponseEntity.ok(page);
    }
}
